home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlib43 / mntlib / pipe.c < prev    next >
C/C++ Source or Header  |  1993-07-06  |  334b  |  27 lines

  1. /*
  2.  * pipe: create a pipe
  3.  * works only under MiNT
  4.  */
  5.  
  6. #include <osbind.h>
  7. #include <errno.h>
  8. #include <mintbind.h>
  9. #include <unistd.h>
  10.  
  11. int
  12. pipe(fd)
  13.     int *fd;
  14. {
  15.     short mint_handle[2];
  16.     long r;
  17.  
  18.     r = Fpipe(mint_handle);
  19.     if (r < 0) {
  20.         errno = (int) -r;
  21.         return -1;
  22.     }
  23.     fd[0] = mint_handle[0];
  24.     fd[1] = mint_handle[1];
  25.     return 0;
  26. }
  27.